<template>
    <el-input v-model="localValue" placeholder="请输入" @change="inputChange" />
</template>

<script>
export default {
    name: 'InputForm',
    props: {
        defaultValue: {
            type: [Number, String],
            default: ''
        }
    },
    data() {
        return {
            localValue: ''
        }
    },
    created() {
        if (this.defaultValue) {
            this.localValue = this.defaultValue
            this.inputChange(this.localValue)
        }
    },
    methods: {
        inputChange(val) {
            this.$emit('input-change', val)
        }
    }
}
</script>

<style></style>
